/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.crossriver.crgis.database.model.impl;

import com.crossriver.crgis.database.model.Application_C_of_O;
import com.crossriver.crgis.database.model.Application_C_of_OModel;
import com.crossriver.crgis.database.model.Application_C_of_OSoap;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.impl.BaseModelImpl;

import java.io.Serializable;

import java.lang.reflect.Proxy;

import java.sql.Types;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * The base model implementation for the Application_C_of_O service. Represents a row in the &quot;CRGIA_Application_C_of_O&quot; database table, with each column mapped to a property of this class.
 *
 * <p>
 * This implementation and its corresponding interface {@link com.crossriver.crgis.database.model.Application_C_of_OModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link Application_C_of_OImpl}.
 * </p>
 *
 * <p>
 * Never modify or reference this class directly. All methods that expect a application_ c_of_ o model instance should use the {@link com.crossriver.crgis.database.model.Application_C_of_O} interface instead.
 * </p>
 *
 * @author Wole Adetiba
 * @see Application_C_of_OImpl
 * @see com.crossriver.crgis.database.model.Application_C_of_O
 * @see com.crossriver.crgis.database.model.Application_C_of_OModel
 * @generated
 */
public class Application_C_of_OModelImpl extends BaseModelImpl<Application_C_of_O>
	implements Application_C_of_OModel {
	public static final String TABLE_NAME = "CRGIA_Application_C_of_O";
	public static final Object[][] TABLE_COLUMNS = {
			{ "applicationId", new Integer(Types.VARCHAR) },
			{ "userId", new Integer(Types.VARCHAR) },
			{ "applicationStartDate", new Integer(Types.TIMESTAMP) },
			{ "dateOfApplication", new Integer(Types.TIMESTAMP) },
			{ "fileNo", new Integer(Types.VARCHAR) },
			{ "oldCofONo", new Integer(Types.VARCHAR) },
			{ "application", new Integer(Types.VARCHAR) },
			{ "applicationType", new Integer(Types.VARCHAR) },
			{ "dateOfIssuance", new Integer(Types.TIMESTAMP) },
			{ "previousCofONumber", new Integer(Types.VARCHAR) },
			{ "landUseType", new Integer(Types.VARCHAR) },
			{ "landUsePurpose", new Integer(Types.VARCHAR) },
			{ "attestation", new Integer(Types.VARCHAR) },
			{ "status", new Integer(Types.VARCHAR) },
			{ "referenceNo", new Integer(Types.VARCHAR) }
		};
	public static final String TABLE_SQL_CREATE = "create table CRGIA_Application_C_of_O (applicationId VARCHAR(75) not null primary key,userId VARCHAR(75) null,applicationStartDate DATE null,dateOfApplication DATE null,fileNo VARCHAR(75) null,oldCofONo VARCHAR(75) null,application VARCHAR(75) null,applicationType VARCHAR(75) null,dateOfIssuance DATE null,previousCofONumber VARCHAR(75) null,landUseType VARCHAR(75) null,landUsePurpose VARCHAR(75) null,attestation VARCHAR(75) null,status VARCHAR(75) null,referenceNo VARCHAR(75) null)";
	public static final String TABLE_SQL_DROP = "drop table CRGIA_Application_C_of_O";
	public static final String ORDER_BY_JPQL = " ORDER BY application_C_of_O.applicationId ASC";
	public static final String ORDER_BY_SQL = " ORDER BY CRGIA_Application_C_of_O.applicationId ASC";
	public static final String DATA_SOURCE = "liferayDataSource";
	public static final String SESSION_FACTORY = "liferaySessionFactory";
	public static final String TX_MANAGER = "liferayTransactionManager";
	public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.entity.cache.enabled.com.crossriver.crgis.database.model.Application_C_of_O"),
			true);
	public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.finder.cache.enabled.com.crossriver.crgis.database.model.Application_C_of_O"),
			true);

	/**
	 * Converts the soap model instance into a normal model instance.
	 *
	 * @param soapModel the soap model instance to convert
	 * @return the normal model instance
	 */
	public static Application_C_of_O toModel(Application_C_of_OSoap soapModel) {
		Application_C_of_O model = new Application_C_of_OImpl();

		model.setApplicationId(soapModel.getApplicationId());
		model.setUserId(soapModel.getUserId());
		model.setApplicationStartDate(soapModel.getApplicationStartDate());
		model.setDateOfApplication(soapModel.getDateOfApplication());
		model.setFileNo(soapModel.getFileNo());
		model.setOldCofONo(soapModel.getOldCofONo());
		model.setApplication(soapModel.getApplication());
		model.setApplicationType(soapModel.getApplicationType());
		model.setDateOfIssuance(soapModel.getDateOfIssuance());
		model.setPreviousCofONumber(soapModel.getPreviousCofONumber());
		model.setLandUseType(soapModel.getLandUseType());
		model.setLandUsePurpose(soapModel.getLandUsePurpose());
		model.setAttestation(soapModel.getAttestation());
		model.setStatus(soapModel.getStatus());
		model.setReferenceNo(soapModel.getReferenceNo());

		return model;
	}

	/**
	 * Converts the soap model instances into normal model instances.
	 *
	 * @param soapModels the soap model instances to convert
	 * @return the normal model instances
	 */
	public static List<Application_C_of_O> toModels(
		Application_C_of_OSoap[] soapModels) {
		List<Application_C_of_O> models = new ArrayList<Application_C_of_O>(soapModels.length);

		for (Application_C_of_OSoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}

	public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
				"lock.expiration.time.com.crossriver.crgis.database.model.Application_C_of_O"));

	public Application_C_of_OModelImpl() {
	}

	public String getPrimaryKey() {
		return _applicationId;
	}

	public void setPrimaryKey(String pk) {
		setApplicationId(pk);
	}

	public Serializable getPrimaryKeyObj() {
		return _applicationId;
	}

	public String getApplicationId() {
		if (_applicationId == null) {
			return StringPool.BLANK;
		}
		else {
			return _applicationId;
		}
	}

	public void setApplicationId(String applicationId) {
		_applicationId = applicationId;
	}

	public String getUserId() {
		if (_userId == null) {
			return StringPool.BLANK;
		}
		else {
			return _userId;
		}
	}

	public void setUserId(String userId) {
		_userId = userId;
	}

	public Date getApplicationStartDate() {
		return _applicationStartDate;
	}

	public void setApplicationStartDate(Date applicationStartDate) {
		_applicationStartDate = applicationStartDate;
	}

	public Date getDateOfApplication() {
		return _dateOfApplication;
	}

	public void setDateOfApplication(Date dateOfApplication) {
		_dateOfApplication = dateOfApplication;
	}

	public String getFileNo() {
		if (_fileNo == null) {
			return StringPool.BLANK;
		}
		else {
			return _fileNo;
		}
	}

	public void setFileNo(String fileNo) {
		_fileNo = fileNo;
	}

	public String getOldCofONo() {
		if (_oldCofONo == null) {
			return StringPool.BLANK;
		}
		else {
			return _oldCofONo;
		}
	}

	public void setOldCofONo(String oldCofONo) {
		_oldCofONo = oldCofONo;
	}

	public String getApplication() {
		if (_application == null) {
			return StringPool.BLANK;
		}
		else {
			return _application;
		}
	}

	public void setApplication(String application) {
		_application = application;
	}

	public String getApplicationType() {
		if (_applicationType == null) {
			return StringPool.BLANK;
		}
		else {
			return _applicationType;
		}
	}

	public void setApplicationType(String applicationType) {
		_applicationType = applicationType;
	}

	public Date getDateOfIssuance() {
		return _dateOfIssuance;
	}

	public void setDateOfIssuance(Date dateOfIssuance) {
		_dateOfIssuance = dateOfIssuance;
	}

	public String getPreviousCofONumber() {
		if (_previousCofONumber == null) {
			return StringPool.BLANK;
		}
		else {
			return _previousCofONumber;
		}
	}

	public void setPreviousCofONumber(String previousCofONumber) {
		_previousCofONumber = previousCofONumber;
	}

	public String getLandUseType() {
		if (_landUseType == null) {
			return StringPool.BLANK;
		}
		else {
			return _landUseType;
		}
	}

	public void setLandUseType(String landUseType) {
		_landUseType = landUseType;
	}

	public String getLandUsePurpose() {
		if (_landUsePurpose == null) {
			return StringPool.BLANK;
		}
		else {
			return _landUsePurpose;
		}
	}

	public void setLandUsePurpose(String landUsePurpose) {
		_landUsePurpose = landUsePurpose;
	}

	public String getAttestation() {
		if (_attestation == null) {
			return StringPool.BLANK;
		}
		else {
			return _attestation;
		}
	}

	public void setAttestation(String attestation) {
		_attestation = attestation;
	}

	public String getStatus() {
		if (_status == null) {
			return StringPool.BLANK;
		}
		else {
			return _status;
		}
	}

	public void setStatus(String status) {
		_status = status;
	}

	public String getReferenceNo() {
		if (_referenceNo == null) {
			return StringPool.BLANK;
		}
		else {
			return _referenceNo;
		}
	}

	public void setReferenceNo(String referenceNo) {
		_referenceNo = referenceNo;
	}

	public Application_C_of_O toEscapedModel() {
		if (isEscapedModel()) {
			return (Application_C_of_O)this;
		}
		else {
			return (Application_C_of_O)Proxy.newProxyInstance(Application_C_of_O.class.getClassLoader(),
				new Class[] { Application_C_of_O.class },
				new AutoEscapeBeanHandler(this));
		}
	}

	public Object clone() {
		Application_C_of_OImpl application_C_of_OImpl = new Application_C_of_OImpl();

		application_C_of_OImpl.setApplicationId(getApplicationId());

		application_C_of_OImpl.setUserId(getUserId());

		application_C_of_OImpl.setApplicationStartDate(getApplicationStartDate());

		application_C_of_OImpl.setDateOfApplication(getDateOfApplication());

		application_C_of_OImpl.setFileNo(getFileNo());

		application_C_of_OImpl.setOldCofONo(getOldCofONo());

		application_C_of_OImpl.setApplication(getApplication());

		application_C_of_OImpl.setApplicationType(getApplicationType());

		application_C_of_OImpl.setDateOfIssuance(getDateOfIssuance());

		application_C_of_OImpl.setPreviousCofONumber(getPreviousCofONumber());

		application_C_of_OImpl.setLandUseType(getLandUseType());

		application_C_of_OImpl.setLandUsePurpose(getLandUsePurpose());

		application_C_of_OImpl.setAttestation(getAttestation());

		application_C_of_OImpl.setStatus(getStatus());

		application_C_of_OImpl.setReferenceNo(getReferenceNo());

		return application_C_of_OImpl;
	}

	public int compareTo(Application_C_of_O application_C_of_O) {
		int value = 0;

		value = getApplicationId()
					.compareTo(application_C_of_O.getApplicationId());

		if (value != 0) {
			return value;
		}

		return 0;
	}

	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		Application_C_of_O application_C_of_O = null;

		try {
			application_C_of_O = (Application_C_of_O)obj;
		}
		catch (ClassCastException cce) {
			return false;
		}

		String pk = application_C_of_O.getPrimaryKey();

		if (getPrimaryKey().equals(pk)) {
			return true;
		}
		else {
			return false;
		}
	}

	public int hashCode() {
		return getPrimaryKey().hashCode();
	}

	public String toString() {
		StringBundler sb = new StringBundler(31);

		sb.append("{applicationId=");
		sb.append(getApplicationId());
		sb.append(", userId=");
		sb.append(getUserId());
		sb.append(", applicationStartDate=");
		sb.append(getApplicationStartDate());
		sb.append(", dateOfApplication=");
		sb.append(getDateOfApplication());
		sb.append(", fileNo=");
		sb.append(getFileNo());
		sb.append(", oldCofONo=");
		sb.append(getOldCofONo());
		sb.append(", application=");
		sb.append(getApplication());
		sb.append(", applicationType=");
		sb.append(getApplicationType());
		sb.append(", dateOfIssuance=");
		sb.append(getDateOfIssuance());
		sb.append(", previousCofONumber=");
		sb.append(getPreviousCofONumber());
		sb.append(", landUseType=");
		sb.append(getLandUseType());
		sb.append(", landUsePurpose=");
		sb.append(getLandUsePurpose());
		sb.append(", attestation=");
		sb.append(getAttestation());
		sb.append(", status=");
		sb.append(getStatus());
		sb.append(", referenceNo=");
		sb.append(getReferenceNo());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(49);

		sb.append("<model><model-name>");
		sb.append("com.crossriver.crgis.database.model.Application_C_of_O");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>applicationId</column-name><column-value><![CDATA[");
		sb.append(getApplicationId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>userId</column-name><column-value><![CDATA[");
		sb.append(getUserId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>applicationStartDate</column-name><column-value><![CDATA[");
		sb.append(getApplicationStartDate());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>dateOfApplication</column-name><column-value><![CDATA[");
		sb.append(getDateOfApplication());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>fileNo</column-name><column-value><![CDATA[");
		sb.append(getFileNo());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>oldCofONo</column-name><column-value><![CDATA[");
		sb.append(getOldCofONo());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>application</column-name><column-value><![CDATA[");
		sb.append(getApplication());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>applicationType</column-name><column-value><![CDATA[");
		sb.append(getApplicationType());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>dateOfIssuance</column-name><column-value><![CDATA[");
		sb.append(getDateOfIssuance());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>previousCofONumber</column-name><column-value><![CDATA[");
		sb.append(getPreviousCofONumber());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>landUseType</column-name><column-value><![CDATA[");
		sb.append(getLandUseType());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>landUsePurpose</column-name><column-value><![CDATA[");
		sb.append(getLandUsePurpose());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>attestation</column-name><column-value><![CDATA[");
		sb.append(getAttestation());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>status</column-name><column-value><![CDATA[");
		sb.append(getStatus());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>referenceNo</column-name><column-value><![CDATA[");
		sb.append(getReferenceNo());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private String _applicationId;
	private String _userId;
	private Date _applicationStartDate;
	private Date _dateOfApplication;
	private String _fileNo;
	private String _oldCofONo;
	private String _application;
	private String _applicationType;
	private Date _dateOfIssuance;
	private String _previousCofONumber;
	private String _landUseType;
	private String _landUsePurpose;
	private String _attestation;
	private String _status;
	private String _referenceNo;
}